<?php
$auth = Auth::getAuth('current_user');
$db = new Database();
$fs = new functions();
$notifications = new notifications();
$upload = new upload();
$post = new post();

    if(isset($_POST['action'])){
        
        $action = $_POST['action'];
        $date = $fs->currentDateTime();
        
            // 
            if($action=="notificationPost"){
                echo json_encode($notifications->noti());
                  
            }
            
	    elseif($action=="updateNoti"){
		$notiID = $_POST['notiID'];
		
		$set = array("user_read" 	=>	1);
		$condition = array("id"		=>	$notiID);
		
		$db->update("tbnotification",$set,$condition);
	    }
    }


?>
